/*============================================================================*/
/*  Copyright (C) 2009-2011, iSOFT INFRASTRUCTURE SOFTWARE CO.,LTD.
 *  
 *  All rights reserved. This software is iSOFT property. Duplication 
 *  or disclosure without iSOFT written authorization is prohibited.
 *  
 *  
 *  @file       <Xcp_Interface.h>
 *  @brief      <Xcp Interface Head file.>
 *  
 *  <Compiler: Codewarrior for mpc55xx v2.6     MCU:MPC56XX>
 *  
 *  @author     <Dongyuan.Sun, qitao.Yu>
 *  @date       <2013-03-06>
 */
/*============================================================================*/
#ifndef  XCP_INTERFACE_H
#define  XCP_INTERFACE_H

/*=======[R E V I S I O N   H I S T O R Y]====================================*/
/*  <VERSION>    <DATE>    <AUTHOR>     <REVISION LOG>
 *  V1.0.0       20081127  Dongyuan.Sun Initial version
 * 
 */
/*============================================================================*/

/*=======[I N C L U D E S]====================================================*/
#include "ComStack_Types.h"
#include "Xcp_Cfg.h"

/*=======[M A C R O S]========================================================*/

/* return code of interface function */
#define XCP_IF_OK           0x00u
#define XCP_IF_NOT_OK       0x01u
#define XCP_IF_BUSY         0x02u
/* mode of nvm/fls interface function */
#define XCP_NVM_ERASE       0x00u
#define XCP_NVM_READ        0x01u
#define XCP_NVM_WRITE       0x02u
#define XCP_FLS_ERASE       0x03u
#define XCP_FLS_WRITE       0x04u




/*=======[E X T E R N A L   F U N C T I O N   D E C L A R A T I O N S]========*/
#if (XCP_SET_MTA == STD_ON)
extern FUNC(uint32, XCP_CODE) Xcp_Mta2Ptr(const uint8 u1AddExt, const uint32 u4Add);
#endif

#if (XCP_BUILD_CHECKSUM == STD_ON)
extern FUNC(void, XCP_CODE) Xcp_ChecksumCompute(const uint32 checksumStartAddress, const uint32 blockSize, uint32* crcResult);
#endif

#if (XCP_PL_PGM == (XCP_PL_PGM & XCP_RESOURCE))
extern FUNC(Std_ReturnType, XCP_CODE) Xcp_FlsReq(uint8 Mode, uint32 u4Address, uint32 u4Size, const uint8* pu1DataPtr);
extern FUNC(uint8, XCP_CODE) Xcp_FlsGetStatus(void);
extern FUNC(void, XCP_CODE) Xcp_FlsMainFunction(void);
extern FUNC(Std_ReturnType, XCP_CODE) Xcp_ProgramStartNoticeApp(void);
extern FUNC(void, XCP_CODE) Xcp_ProgramResetNoticeApp(void);
#endif

#if (XCP_PL_STIM == (XCP_PL_STIM & XCP_RESOURCE))
extern FUNC(boolean, XCP_CODE) Xcp_StimOverloadIndication (uint16 eventNum, uint16 daqNum);
#endif

#if (XCP_SEED_AND_UNLOCK == STD_ON)
extern FUNC(Std_ReturnType, XCP_CODE) Xcp_CreateSeed(uint8* length, uint8* seed, const uint8 resource);
extern FUNC(boolean, XCP_CODE) Xcp_IsKeyRight(const uint8* seed, const uint8* key, const uint8 lengthS,const uint8 lengthK, const uint8 resource);
#endif

#endif

/*=======[E N D   O F   F I L E]==============================================*/

